<?php

//var_dump($_POST);
//var_dump(count($_POST["file_info"]));
var_dump($_POST);
//var_dump($_POST["file_info"]);
//var_dump($_POST["file_info"]);

//var_dump($_FILES);

//fixFilesArray($_FILES['file']);
//echo count($_FILES['file']);

foreach ($_FILES['file'] as $position => $file) {
  // should output array with indices name, type, tmp_name, error, size
//  var_dump($file);
}
/**
 * Fixes the odd indexing of multiple file uploads from the format:
 *
 * $_FILES['field']['key']['index']
 *
 * To the more standard and appropriate:
 *
 * $_FILES['field']['index']['key']
 *
 * @param array $files
 * @author Corey Ballou
 * @link http://www.jqueryin.com
 */
function fixFilesArray(&$files)
{
  $names = array('name' => 1, 'type' => 1, 'tmp_name' => 1, 'error' => 1, 'size' => 1);

  foreach ($files as $key => $part) {
    // only deal with valid keys and multiple files
    $key = (string)$key;
    if (isset($names[$key]) && is_array($part)) {
      foreach ($part as $position => $value) {
        $files[$position][$key] = $value;
      }
      // remove old key reference
      unset($files[$key]);
    }
  }
}

//$input = file_get_contents('php://input');
//file_put_contents("uploadfile.txt", $input);